﻿package code {
	
	public class Rect extends BaseShape {
		private var rectHeight:int;  // height of the rectangle
		
		// creates a rectangle 
		public function Rect(radius:Number, sides:Number, color:uint, thickness:Number, hollow:Boolean, angle:Number, rectHeight:int) {
			super(radius, sides, color, thickness, hollow, angle)
			this.rectHeight = rectHeight;
			this.angle = angle;
			init();
		}
		
		private function init(){
			makeVertices();
			rotateVertices();
			renderVertices();
		}
		
		override public function makeVertices():void{
			var x1 = new Vertex(x, y);  // makes initial vertex
			var x2 = new Vertex(x + radius, y);  // makes second vertex at radius away
			var x3 = new Vertex(x, y + rectHeight);  // makes third vertex at height away
			var x4 = new Vertex(x + radius, y + rectHeight);  // makes final veretx at width and height away
			
			vertices.push(x2, x4, x3, x1);
		}

	}
	
}
